package com.xbongbong.paas.manager.feign;

import com.xbongbong.paas.toolbox.wrap.BaseVO;
import com.xbongbong.paas.toolbox.wrap.XbbResponse;
import com.xbongbong.pro.user.pojo.dto.SyncOrganizationDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * 跨服务调用组织架构相关接口
 * @author kaka
 * @date 2019/4/26 10:09
 * @since v1.0
 * @version v1.0
 */
@FeignClient(name = "pro-web-dingtalk",contextId = "organizationFeignClient")
public interface OrganizationFeignClient {

    /**
     * 手动触发同步组织架构
     * @param syncOrganizationDTO 关联业务DTO
     */
    @RequestMapping(value = "/pro/v1/dingtalk/syncDepartmentUser", method = RequestMethod.POST,
            consumes = MediaType.APPLICATION_JSON_UTF8_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    XbbResponse<BaseVO> syncDepartmentUser(@RequestBody SyncOrganizationDTO syncOrganizationDTO, @RequestParam("lang") String lang);
}
